﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Globalization;
using common;
using System.Drawing;

namespace test
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            application.SysLibs.SetAppEnvironment();
            //SetColor();
            application.ConfigLibs.Load_Sys_Settings();
            application.ConfigLibs.Load_User_Config(false);

            CommonTypes.Settings.sysLoginInfo.Name = CommonTypes.Settings.sysSuperAdminName;
            CommonTypes.Settings.sysLoginInfo.UserId = 1;
            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            CommonTypes.Settings.sysLoginInfo.Type = CommonTypes.Consts.constUserTypeAdmin;

            CommonTypes.Settings.sysWorkPeriodStart = DateTime.Today.AddYears(-10);
            CommonTypes.Settings.sysWorkPeriodEnd = DateTime.Today.AddYears(1);

            CommonTypes.Settings.sysDebugMode = true;
            //common.language.myCulture = new System.Globalization.CultureInfo("vi-Vn");

            //bugFix.accounting.DoBugFix();
            //TestCR();
            Application.Run(TestForm());
            //Application.Run(new test());
        }

        private static common.forms.baseForm TestForm()
        {
            //baseClass.Forms.userList myForm = new baseClass.Forms.userList();
            //baseClass.Forms.userFind myForm = new baseClass.Forms.userFind();

            //wage.Forms.workShiftList myForm = new wage.Forms.workShiftList();
            //wage.Forms.workShiftFind myForm = new wage.Forms.workShiftFind();
            //wage.Forms.workShiftList myForm = new wage.Forms.workShiftList();
            
            //baseClass.Forms.userLogin  myForm = new baseClass.Forms.userLogin();
            //baseClass.Forms.changePassword myForm = new baseClass.Forms.changePassword();
            //baseClass.Forms.sysCodeEdit myForm = new baseClass.Forms.sysCodeEdit();

            //baseClass.Forms.itemList myForm = new baseClass.Forms.itemList();
            //baseClass.Forms.itemFind myForm = new baseClass.Forms.itemFind();

            //baseClass.Forms.projectList myForm = new baseClass.Forms.projectList();
            //baseClass.Forms.projectFind myForm = new baseClass.Forms.projectFind();

            //employee.Forms.employeeList myForm = new employee.Forms.employeeList();
            //employee.Forms.employeeFind myForm = new employee.Forms.employeeFind();

            import.Forms.importEmployee myForm = new import.Forms.importEmployee();

            //baseClass.Forms.statementFind myForm = new baseClass.Forms.statementFind();
            //myForm.SetStatementType("PAY");

            //employee.Forms.test myForm = new employee.Forms.test();

            //test myForm = new test();
            //Form2 myForm = new Form2(); 

            myForm.myPermission.Set(common.PermissionCodes.All);
            return myForm;
        }
        

        public static void SetColor()
        {
            //====================
            // Menu
            //====================
            common.Settings.myTheme.MenuMain.Main = new common.Theme.ColorSet(ColorTranslator.FromHtml("#036082"), ColorTranslator.FromHtml("#059cd4"));

            common.Settings.myTheme.MenuMain.Sub = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#0484b2"));
            common.Settings.myTheme.MenuMain.Image = new common.Theme.ColorSet(ColorTranslator.FromHtml("#0484b2"), ColorTranslator.FromHtml("#ffffff"));

            common.Settings.myTheme.MenuMain.Selection = new common.Theme.ColorSet(ColorTranslator.FromHtml("#036082"), ColorTranslator.FromHtml("#036082"));
            common.Settings.myTheme.MenuMain.Drop = new common.Theme.ColorSet(ColorTranslator.FromHtml("#00417b"), ColorTranslator.FromHtml("#00417b"));
            common.Settings.myTheme.MenuMain.Line = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#ffffff"));

            //====================
            //Button
            //====================
            common.Settings.myTheme.Button = new common.Theme.ColorSet(Color.White, ColorTranslator.FromHtml("#b2c3db")); // 9fc5d0

            //====================
            //Form 
            //====================
            common.Settings.myTheme.FormMain.Body = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#0e99ba"));
            common.Settings.myTheme.FormData.Body = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.FormLogin.Body = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#0e99ba"));

            //=======================
            // Tab Control : main
            //=======================
            common.Settings.myTheme.TabMain.Main = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.TabMain.ActivePage = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#00417b"));
            common.Settings.myTheme.TabMain.Pages = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#bbdbf0"));

            //=======================
            // Tab Control : list
            //=======================
            common.Settings.myTheme.TabList.Main = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#9fc5d0"));
            common.Settings.myTheme.TabList.ActivePage = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#d8e9f1"));
            common.Settings.myTheme.TabList.Pages = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#9fc5d0"));

            //====================================================================================================
            //Grid List : RowHeader, ColumnHeader, Row, RowAlternate, Selection, BackAndBorder,  ReadOnly, HiLight
            //====================================================================================================
            common.Settings.myTheme.GridList.ColumnHeader = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#9fc5d0"));
            common.Settings.myTheme.GridList.Row = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#d8e9f1"));
            common.Settings.myTheme.GridList.RowAlternate = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#9fc5d0"));
            common.Settings.myTheme.GridList.RowHeader = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#9fc5d0"));
            common.Settings.myTheme.GridList.RowSelection = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#00417b"));
            common.Settings.myTheme.GridList.LineAndBackground = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#d8e9f1"));

            //====================================================================================================
            //Grid Edit : RowHeader, ColumnHeader, Row, RowAlternate, Selection, BackAndBorder,  ReadOnly, HiLight
            //====================================================================================================
            common.Settings.myTheme.GridEdit.ColumnHeader = new common.Theme.ColorSet(ColorTranslator.FromHtml("#ffffff"), ColorTranslator.FromHtml("#00417b"));
            common.Settings.myTheme.GridEdit.Row = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.GridEdit.RowAlternate = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.GridEdit.RowHeader = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.GridEdit.RowSelection = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#ffffff"));
            common.Settings.myTheme.GridEdit.LineAndBackground = new common.Theme.ColorSet(ColorTranslator.FromHtml("#000000"), ColorTranslator.FromHtml("#c2d3e0"));
            common.Settings.myTheme.GridEdit.ReadOnly = new common.Theme.ColorSet(Color.Red, ColorTranslator.FromHtml("#c2d3e0"));

            return;
            //this.WallPaperPath = "images\\wallpaper.jpg";

            //this.Normal = new Theme.ColorSet(Color.White, Color.FromArgb(255, 172, 203, 223));
            //this.Edit = new Theme.ColorSet(Color.Black, Color.White);
            //this.Info = new Theme.ColorSet(Color.Brown, Color.FromArgb(255, 172, 203, 223));
            //this.HiLight = new Theme.ColorSet(Color.Red, Color.FromArgb(255, 172, 203, 223));

            //this.Header = new Theme.ColorSet(Color.Navy, Color.FromArgb(255, 172, 203, 223));
            //this.SubHeader = new Theme.ColorSet(Color.Green, Color.FromArgb(255, 172, 203, 223));

            //this.Label = new Theme.ColorSet(Color.Blue, Color.FromArgb(255, 172, 203, 223));
            //this.Button = new Theme.ColorSet(Color.White, Color.Green); //Color.FromArgb(255, 142, 173, 190)
            //this.Form = new Theme.ColorSet(Color.White, Color.FromArgb(255, 172, 203, 223));
        }
    }
}
